﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using KaytechSoftware.Cms.Entities;
using KaytechSoftware.Cms.Services.Interfaces;
using KaytechSoftware.Cms.Services.Interfaces.Entity;

namespace KaytechSoftware.Cms.Services.Dto
{
    public class PhotoDto : IDto
    {
        public long Id { get; set; }
        public long Version { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public long Order { get; set; }
        public long PhotoAlbumId { get; set; }
        public string PhotoAlbumTitle { get; set; }
        public byte[] Data { get; set; }

        public PhotoDto(Photo photo)
        {
            Id = photo.Id;
            Version = photo.Version;
            Title = photo.Title;
            Description = photo.Description;
            Order = photo.Order;
            PhotoAlbumId = photo.PhotoAlbumId;
            if (photo.PhotoAlbum != null)
                PhotoAlbumTitle = photo.PhotoAlbum.Title;
        }

        public PhotoDto()
        {
            
        }
    }
}
